package com.lenovo.redission.redission.config.lock;

import com.lenovo.redission.redission.lock.IDistributedLock;
import com.lenovo.redission.redission.lock.RedissonDistributedLock;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DistributedLockAutoConfiguration {

    private Logger logger = LogManager.getLogger(this.getClass());

    @Bean
    public IDistributedLock redisDistributedLock() {
        return new RedissonDistributedLock();
    }

    @Bean
    public LockUtil lockUtil(IDistributedLock redisDistributedLock) {
        return new LockUtil(redisDistributedLock);
    }

}